package com.xlcszsgc.module.blob.domain;

import java.io.Serializable;
import java.sql.Blob;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;


/**
 * @Title: BaseBlob.java
 * @Package com.xlcszsgc.module.blob.domain
 * @Description: blob支持
 * @author Zhaoqt
 * @date 2014-5-23 上午12:09:25
 * @version V1.0
 */
@Entity
@Table(name = "BASE_BLOB")
public class BaseBlob implements Serializable {

	private static final long serialVersionUID = 1L;

	private String blobId;
	private String attName;
	private String title;
	private String size;
	private Blob blob;
	private String categoryCode;
	private Integer sortNum;
	private BaseBlob baseBlob;
	
	@Id 
	@Column(name = "BLOB_ID")
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	public String getBlobId() {
		return blobId;
	}

	public void setBlobId(String blobId) {
		this.blobId = blobId;
	}

	@Column(name = "ATT_NAME")
	public String getAttName() {
		return attName;
	}

	public void setAttName(String attName) {
		this.attName = attName;
	}

	@Column(name = "SIZE")
	public String getSize() {
		return size;
	}

	public void setSize(String size) {
		this.size = size;
	}

	@Column(name = "ATT_BLOB")
	public Blob getBlob() {
		return blob;
	}

	public void setBlob(Blob blob) {
		this.blob = blob;
	}

	@Column(name = "CATEGORY_CODE")
	public String getCategoryCode() {
		return categoryCode;
	}

	public void setCategoryCode(String categoryCode) {
		this.categoryCode = categoryCode;
	}
	
	@Column(name = "SORT_NUM")
	public Integer getSortNum() {
		return sortNum;
	}

	public void setSortNum(Integer sortNum) {
		this.sortNum = sortNum;
	}


	@ManyToOne(cascade =CascadeType.REMOVE)
	@JoinColumn(name = "BIG_BLOB_ID")
	public BaseBlob getBaseBlob() {
		return baseBlob;
	}

	public void setBaseBlob(BaseBlob baseBlob) {
		this.baseBlob = baseBlob;
	}

	@Column(name = "TITLE")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
}
